﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using OTS.Model;

/// <summary>
/// MemberPage 的摘要说明
/// </summary>
/// 
namespace OTS
{
    public class MemberPage : System.Web.UI.Page
    {
        public MemberPage()
        {
            //
            // TODO: 在此处添加构造函数逻辑
            //
        }
        /// <summary>
        /// 查看是否登陆
        /// </summary>
        /// <param name="context"></param>
        public bool TestLogin(HttpContext context)
        {
            if (context.Session["custom"] == null)
            {
                context.Response.Redirect("login.aspx?redirectUrl=" + Request.RawUrl.ToString());    //redirectUrl=" + Request.RawUrl.ToString()
                return false;
            }
            return true;
        }
        public void ClearSession(HttpContext context)
        {
            context.Session["custom"] = null;
        }
        public OTS.Model.custom GetCustom(HttpContext context)
        {
            if (TestLogin(context))
            {
                return (OTS.Model.custom)context.Session["custom"];
            }
            else
            {
                return null;
            }
        }


    }
}
